package cn.com.yto56.cainiao.exponent.es.controller;

import cn.com.yto56.basic.framework.model.rest.EmptyResponse;
import cn.com.yto56.cainiao.exponent.elasticsearch.service.ExponentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/indice")
@Slf4j
@Api(tags = "ES索引管理接口")
public class IndicesController {

  @Autowired
  private ExponentService exponentService;

  /**
   * 创建索用模板
   *
   * @return 成功失败列表
   */
  @PostMapping(value = "")
  @ApiOperation(value = "创建索引及temp")
  public EmptyResponse buildExponentTemplate() {
    exponentService.buildOriginIndiceTemp("ExponentTemplate");
    return new EmptyResponse();
  }
}
